package com.qxcy.gzy.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class SPUtils {

	public static void setValueSharedFile(Context context, String key,
			String value) {
		SharedPreferences sp = PreferenceManager
				.getDefaultSharedPreferences(context);
		sp.edit().putString(key, value).commit();
	}

	public static String getValueFromSharedFile(Context context, String key,
			String defaultValue) {
		SharedPreferences sp = PreferenceManager
				.getDefaultSharedPreferences(context);
		return sp.getString(key, defaultValue);
	}

	public static void deleteValueFromSharedFile(Context context, String key) {
		SharedPreferences sp = PreferenceManager
				.getDefaultSharedPreferences(context);
		sp.edit().remove(key).commit();
	}
}
